package net.xdclass.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

/**
 * @Classname AliPayConfig
 * @Description TODO
 * @Date 2022/5/26 17:55
 * @Created by sunhao
 */

public class AliPayConfig {
  public static String APPID = "2016100100636327";

  public static String PRIVATEKEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCj9sOTL0yg+/9b11ZK+WVydU3Mf7cNorov1hs0uNcq+ZXoDiIq+5l70xT/k49M2O/IKsv2UqRIuZCFndMLv2thSxQmgdMzhFuq8qJ6kj26TtuPy668UEBwRSsFJCRioNBboO/vCom4+iUoWrX8gOUYUF+J26kcyrx6NkTRivcpXFdYupP/N6s0qtv4E0NgzYYCPj8B0X05RDq5CU76DhN3Rzq2SJO8ESkrAWa5NuucIMjukYrSXEY6VoNHypykv6BOrjxk29PCt1tkuI9NdchKbigCpKsPgK0u7OVlxXWzMxp+dKY3x+ScVhDzJ3HqaQQcQYjGMZfsnElPR/WW0ldTAgMBAAECggEABwZzqsLEDcG+VzkKwXueFSFhi/mM5lCqmZIa6E9jKLw46BBy9lSBZwTMSYcRBMHmxDTROGSiFVueDZuNh1tURn7pBh1Z50Msik6LF6Vcb7chQTAA9KCbojPUfAvoYzFwu/xRS3SwIfTV0rzQP1lmd3w6G7YFsO4e1T2uBSxnGqaAqFM4hlo1BuphH7m0gFecZpYqOmOLopAIweSE4sYZadroVqeq5cCGf/MUrCimM4ej76RPdxjRoMdrOf39Nj4gleA3iIq+J7dyg2CT4gfwFNDruN5wjKJhpuqXG1tVD+1ynUn/UYCPDCG3HwzNQPWBh1dPn9lkB4F9fmoQDs9XwQKBgQDQq9hnUPNvK19lhTCfvz1RLqTXS0PGvjlPTzrNsvJijtK7QL1yDLBvPI46T4If2Nb5ktiXHl5C0Th0gJOy70KrxXPWlisiZJ5orEocXTbI8noCYdIqArUsaIhhiBSOlaY/fLdoiaGRUiOk4LZkww5WLQOej2SJ8JaBz+O/5JcfnQKBgQDJJ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BZFmeyr3znMQgFDrawIDAQAB";

  public static String SIGNTYPE = "RSA2";

  public static String CHARSET = "utf-8";

  public static String FORMART = "json";

  public static String GETWAY = "https://openapi.alipaydev.com/gateway.do";


  public static void setInstance(AlipayClient instance) {
    AliPayConfig.instance = instance;
  }

  /**
   * 构造函数私有化
   */
  private AliPayConfig() {

  }

  private volatile static AlipayClient instance = null;

  /**
   * 单例模式 双重检查
   */
  public synchronized static AlipayClient getInstance() {
    if (instance == null) {
      synchronized (AliPayConfig.class) {
        instance = new DefaultAlipayClient(GETWAY, APPID, PRIVATEKEY, FORMART, CHARSET, PUBLICKEY, SIGNTYPE);
      }
    }
    return instance;
  }
}
